<!DOCTYPE HTML>
<html>
<head>
    {include file="common:meta"}
    <style>
        .query-content div{
            float: left;
            margin-right: 20px;
        }
        .btn-margin{
            margin-right: 10px;
        }
    </style>
</head>
<body>
<input type="hidden" value="{$family_id}" id="family_id"/>
<input type="hidden" value="{$user_id}" id="user_id"/>
<div class="page-container">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="query-content clearfloat">
                <div class="form-group">
                    <label class="control-label">
                        <label class="control-label">
                            <input type="hidden" class="form-control date-search" id="time" placeholder="">
                        </label>
                    </label>
                </div>
            </div>
            <table class="table table-bordered">
                <thead id="tr_info">
                <tr>
                    <th>用户ID</th>
                    <th>用户名</th>
                    <th>手机号<th>
                    粉丝数
                    <th>关注数</th>
                    <th>是否族长</th>
                    <th>操作</th>
                </tr>

                </thead>
                <tbody id="info">
                </tbody>
            </table>
        </div>
    </div>
</div>
{include file="common:footer"}
<script>
    window.onload = getData();
    //获取收入数据
    function getData(){
        var queryTime = $('#time').val(),family_id = $('#family_id').val(),user_id = $('#user_id').val();
        var datas = {
            family_id:family_id,
            user_id:user_id
        };
        if(queryTime.length)
            datas.queryTime = queryTime;
        $.ajax({
            type:'get',
            url:'/FamilyMemberInfoData',
            data:datas,
            dataType:'json',
            success:function(result){
                //console.log(result);
                if(result.resultCode == 100){


                    var htmlElement = '',data = result.resultData;
                    for(var i in data){
                        htmlElement += "<tr><td>"+ data[i].u_id + "</td><td>"+ data[i].nickname +"</td><td>"+data[i].phone +"</td><td>"+data[i].followers +"</td><td>"+data[i].friends +"</td><td>"+data[i].is_head + "</td><td class='btn-margin'><button class='user_info btn btn-warning btn-sm btn-margin'>查看用户信息</button></td></tr>";

                    }
                    $('#info').html(htmlElement);
                    var UserInfoObj = $('.user_info');
                    if(UserInfoObj.length){
                        //查看礼物详情
                        UserInfoObj.on('click',function(){
                            var dates = $(this).parent().siblings('td').eq(0).text();
                            layer.open({
                                type: 2,
                                title: ['用户信息（' + dates + '）','font-size:18px;font-family:宋体;font-weight:700;'],
                                shadeClose: true,
                                shade: false,
                                maxmin: true, //开启最大化最小化按钮
                                area: ['800px', '500px'],
                                content:"/UserInfo?user_id="  + user_id,
                                offset:'auto',
                                scrollbar:false
                            });
                        });
                    }
                }
                else{
                    $('#info').empty();
                }
            },
            error:function(err){
                layer.msg('服务器开小差了！',{
                    time:2000
                });
            }
        });
    }
</script>
</body>
</html>